<template>
  <a-form :model="siderForm" layout="vertical" disabled>
    <a-form-item field="projectCode" label="项目号">
      <a-input v-model="siderForm.projectCode"> </a-input>
    </a-form-item>
    <a-form-item field="materialName" label="机型">
      <a-input v-model="siderForm.materialName"> </a-input>
    </a-form-item>
    <a-form-item field="calcBasis" label="三期起始依据">
      <a-input v-model="siderForm.calcBasis" />
    </a-form-item>
    <a-form-item field="storageDate" label="有效期">
      <a-date-picker v-model="siderForm.storageDate" style="width: 100%" />
    </a-form-item>
    <a-form-item field="recheckDate" label="下次复验期">
      <a-date-picker v-model="siderForm.recheckDate" style="width: 100%" />
    </a-form-item>
    <a-form-item field="oilSealDate" label="下次油封期">
      <a-date-picker v-model="siderForm.oilSealDate" style="width: 100%" />
    </a-form-item>
    <a-form-item field="mdsInventoryName" label="目的库房">
      <a-input v-model="siderForm.mdsInventoryName" />
    </a-form-item>
    <a-form-item
      v-if="position === 'Submission'"
      field="refuseManCode"
      label="退回人"
    >
      <a-input v-model="siderForm.refuseManCode" />
    </a-form-item>
    <a-form-item
      v-if="position === 'Submission'"
      field="refuseDate"
      label="退回日期"
    >
      <a-input v-model="siderForm.refuseDate" />
    </a-form-item>
    <a-form-item
      v-if="position === 'Submission'"
      field="refuseReason"
      label="退回原因"
    >
      <a-input v-model="siderForm.refuseReason" />
    </a-form-item>
  </a-form>
</template>

<script lang="ts" setup>
  import { ref } from 'vue';

  const siderForm = ref({
    projectCode: '',
    materialName: '',
    calcBasis: '',
    storageDate: '',
    recheckDate: '',
    oilSealDate: '',
    mdsInventoryName: '',
    refuseManCode: '',
    refuseDate: '',
    refuseReason: '',
  });
  // 筛选弹出清除
  const init = async (data) => {
    Object.assign(siderForm.value, data);
  };
  defineExpose({ init });
</script>

<style lang="less" scoped>
  /deep/ .arco-picker {
    width: 100%;
  }

  .view-background {
    padding: 16px;
    background: #f7f9fc;
  }
</style>
